package com.bclz.common;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;

public class FileUtils {
		
	
	
	public static void saveFile(InputStream originalFile,File TargetFile) throws Exception {
		
		BufferedInputStream bufInput=new  BufferedInputStream(originalFile);
		BufferedOutputStream bufoutput=new  BufferedOutputStream(new FileOutputStream(TargetFile));
		byte[] data=new byte[1024];
		int num=0;
		while((num=bufInput.read(data))>0) {
			bufoutput.write(data, 0, num);
		}
		bufoutput.close();
		bufInput.close();
		
	}
	
	
}
